﻿using Common;
using MongoDB.Driver;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace AnesSystem
{
    public class HelperManager : BaseManager<HelperManager>
    {

        private MongoDBHelper _mongoDbHelper;
        //[MongoDB.Bson.Serialization.Attributes.BsonDateTimeOptions(Kind = DateTimeKind.Local)]

        public MongoDBHelper MongoDB
        {
            get
            {
                if (_mongoDbHelper == null)
                {
                    _mongoDbHelper = new MongoDBHelper(HospitalConfig.Instance.CurrentHospital.Ip, HospitalConfig.Instance.CurrentHospital.Port, HospitalConfig.Instance.CurrentHospital.DbName, HospitalConfig.Instance.CurrentHospital.DbUser, HospitalConfig.Instance.CurrentHospital.DbPwd);
                }
                return _mongoDbHelper;
            }
        }
    }
}
